import styles from './styles.less';
import {Button} from 'antd';
import {useAccess, Access, connect} from 'umi';

const Opera = (props) => {

  const {setDataForm} = props.data;
  const access = useAccess();

  /* 新增操作 */
  function add(e) {
    e.preventDefault();
    setDataForm({
      visible: true,
      title: '添加操作',
      data: undefined,
    });
  }

  return (
    <div className={styles.myOperaAction}>
      <div className={styles.leftContent}>
        <Access accessible={access?.mall_serveCate_add ?? false}>
          <Button type='primary' onClick={add}>
            新增操作
          </Button>
        </Access>
      </div>
    </div>
  );
};

export default connect(({loading}) => {
  return {
    submitting: loading.effects['PMallServeCates/del'],
  };
})(Opera);

